import React, { Component } from 'react';
import { StyleSheet, Text, View, Dimensions, TextInput } from "react-native";
import { offerStyle } from './offerStyle';
import { style } from '../../../../../theme/style';
import Utils from '../../../../../utils/utils';

const ScreenWidth = Dimensions.get('window').width;
const scale = ScreenWidth / 375;

export class RemarkCpt extends Component {
	constructor(props) {
		super(props);
		this.state = {}
	}


	render () {
		let { data, callBack } = this.props;
		let { title, selectKey, id } = data || {};
		return (
			<View style={style.remark}>
				<Text style={styles.remarkTitle}>{title || '-'}</Text>
				<TextInput underlineColorAndroid='transparent' style={[styles.textArea, offerStyle.fontBold]} defaultValue={Utils.numberToString(selectKey)} multiline={true} numberOfLines={6} maxLength={2000} placeholder='限定2000字' onChangeText={(value) => {
					console.log('str', value, value)
					callBack && callBack({ [id]: value });
				}} />
			</View>
		)
	}
}

const styles = StyleSheet.create({
	textArea: {
		height: 64 * scale,
		backgroundColor: '#fff',
		marginTop: 10 * scale,
		borderRadius: 8 * scale,
		paddingHorizontal: 15 * scale,
		paddingVertical: 35 * scale,
		paddingVertical: 0,
		borderWidth: 0,
		marginBottom:20*scale
	}

})